import { defineStore } from "pinia"

const mainStore = defineStore("vipCardLevel", {
    state(){
        return {
            vipCardLevel:[],//获取会员卡等级数据
            vipCardLevelById:[],//根据id查询会员卡等级数据
            integralRuleById:[],//根据id查询积分数据
        }
    },
    persist: {
        enabled: true, // 开启持久化保存
    },
    actions: {
        setPageVipCardLevel(vipCardLevel:Array<any>){
            // console.log("store数据",vipCardLevel);
            this.vipCardLevel = vipCardLevel
            //  console.log("数据存储", this.vipCardLevel);
        },
        setVipCardLevelById(vipCardLevelById:Array<any>){
            this.vipCardLevelById = vipCardLevelById
            //  console.log("数据存储", this.vipCardLevelById);
        },
        setIntegralRuleById(integralRuleById:Array<any>){
            this.integralRuleById = integralRuleById
            // console.log("数据存储", this.integralRuleById);
        }
    },
    getters: {
        getVipCardLevel():Array<any>{
            return this.vipCardLevel
        },
        getVipCardLevelById():Array<any>{
            console.log(123);
            
            console.log("会员卡等级数据", this.vipCardLevelById);
            return this.vipCardLevelById
        },
        getIntegralRuleById():Array<any>{
            // console.log(this.SearchVipCardListByIdList);
            return this.integralRuleById
        }
    }
})


export default mainStore;